package com.itqf.service.impl;

import com.itqf.entity.TransactionRecord;
import com.itqf.mapper.TransactionRecordMapper;
import com.itqf.service.TransactionRecordService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;

/**
 * @Description:
 * @Company: 千锋互联
 * @Author: 李丽婷
 * @Date: 2020/11/12
 * @Time: 上午11:33
 */
@Service
@Transactional(isolation = Isolation.DEFAULT,propagation = Propagation.NESTED)
public class TransactionRecordServiceImpl implements TransactionRecordService {

    @Resource
    private TransactionRecordMapper transactionRecordMapper;


    @Override
    public void insertRecord(TransactionRecord transactionRecord) {
        transactionRecordMapper.insert(transactionRecord);
        int i = 10/0;//模拟异常
    }
}
